﻿using University.Workshop.DataAccess;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Data;
using University.Workshop.Model;
using System.Collections.ObjectModel;
using University.Workshop.Business;
using System.Globalization;

namespace University.Workshop.Tests
{
    
    
    /// <summary>
    ///This is a test class for ProductDataAccessTest and is intended
    ///to contain all ProductDataAccessTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ProductDataAccessTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for GetProductsBySeller
        ///</summary>

        [TestMethod()]
        public void GetProductsBySellerTestCorrect()
        {
            long sellerId = 1; // TODO: Initialize to an appropriate value
            DataSet expected = null; // TODO: Initialize to an appropriate value
            DataSet actual;
            actual = ProductDataAccess.GetProductsBySeller(sellerId);
            Assert.AreNotEqual(expected, actual);
        }

        /// <summary>
        ///A test for ModifyProduct
        ///</summary>
        [TestMethod()]
        public void ModifyProductTest()
        {
            Product product = null; // TODO: Initialize to an appropriate value
            Product expected = null; // TODO: Initialize to an appropriate value
            Product actual;
            actual = ProductDataAccess.ModifyProduct(product);
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for GetProductsBySeller
        ///</summary>
        [TestMethod()]
        public void GetProductsBySellerTest()
        {
            Random rand = new Random();
            string email = "test" + rand.Next(500) + "@test.com";
            UserRegistrationManager.RegisterUser("Juan", "Perez", 'M', DateTime.Now, email, "saramontano1", "saramontano1", "Cochabamba", "Cochabamba", "79718989", "4483251");
            long sellerId = 1; // TODO: Initialize to an appropriate value
            bool noDataTable = true; // TODO: Initialize to an appropriate value
            Collection<Product> expected = null; // TODO: Initialize to an appropriate value
            Collection<Product> actual;
            actual = ProductDataAccess.GetProductsBySeller(sellerId, noDataTable);
            Assert.AreNotEqual(expected, actual);
        }

        /// <summary>
        ///A test for GetProductsByUser
        ///</summary>
        [TestMethod()]
        public void GetProductsByUserTest()
        {
            Random rand = new Random();
            string email = "test" + rand.Next(500) + "@test.com";
            UserRegistrationManager.RegisterUser("Juan", "Perez", 'M', DateTime.Now, email, "saramontano1", "saramontano1", "Cochabamba", "Cochabamba", "79718989", "4483251");
            User user = UserDataAccess.GetUserByEmail(email); // TODO: Initialize to an appropriate value
            DataTable expected = null; // TODO: Initialize to an appropriate value
            DataTable actual;
            actual = ProductDataAccess.GetProductsByUser(user);
            Assert.AreNotEqual(expected, actual);
        }

        /// <summary>
        ///A test for ViewProductsOnSale
        ///</summary>
        [TestMethod()]
        public void SuccesfullViewProducts()
        {
            string firstName = "Pedro"; // TODO: Initialize to an appropriate value
            string lastName = "Suarez"; // TODO: Initialize to an appropriate value
            char gender = 'M'; // TODO: Initialize to an appropriate value
            Random rand = new Random();
            DateTime birthday = DateTime.Now.AddYears(-18); // TODO: Initialize to an appropriate value
            string email = "pedro" + rand.Next(400) + "@gmail.com"; // TODO: Initialize to an appropriate value
            //string email = "juan@hotmail.com";
            string password = "qwert1"; // TODO: Initialize to an appropriate value
            string rePassword = "qwert1"; // TODO: Initialize to an appropriate value
            string department = "Cochabamba"; // TODO: Initialize to an appropriate value
            string city = "Cercado"; // TODO: Initialize to an appropriate value
            string movilephone = "" + rand.Next(79999999); // TODO: Initialize to an appropriate value
            string phone = "" + rand.Next(4999999); // TODO: Initialize to an appropriate value
            Collection<RegisterError> actual;
            actual = UserRegistrationManager.RegisterUser(firstName, lastName, gender, birthday, email, password, rePassword, department, city, movilephone, phone);

            ProductRegistrationManager.RegisterNewProduct("iPhone 2 16GB apple", "5234", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("SCARF calvin klein", "334", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("iPhone 32GB", "1234", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "4");
            ProductRegistrationManager.RegisterNewProduct("BlackBerry Curve 8530", "1234", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("Boat 1996 Wellcraft", "5234", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Motors", false, "Bolivianos", 1, "2");
            ProductRegistrationManager.RegisterNewProduct("green dress & scarf Taylor", "60", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Bolivianos", 1, "5");
            ProductRegistrationManager.RegisterNewProduct("scarf collection JennyHan ", "34", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("apple iPhone 4G 1GB", "1234", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "2");
            ProductRegistrationManager.RegisterNewProduct("computadoras portatiles", "5234", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("deportivos americanos", "334", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("men suits and tuxedo calvin klein", "1690", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Bolivianos", 1, "3");
            ProductRegistrationManager.RegisterNewProduct("cellphone Sony SGH A877", "690", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "3");
            ProductRegistrationManager.RegisterNewProduct("cellphone SAMSUNG sch r720", "690", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "5");
            ProductRegistrationManager.RegisterNewProduct("green scarf AnnTaylor", "60", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Bolivianos", 1, "5");
            ProductRegistrationManager.RegisterNewProduct("TUXEDO OlegCassini", "690", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Bolivianos", 1, "5");
            ProductRegistrationManager.RegisterNewProduct("Motorcycle Touring FLHTCU classic", "690", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Motors", false, "Bolivianos", 1, "5");
            ProductRegistrationManager.RegisterNewProduct("motorcycle 2006 hardley", "690", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Motors", false, "Bolivianos", 1, "5");
            ProductRegistrationManager.RegisterNewProduct("honda motorcycle CB-750", "690", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Motors", false, "Bolivianos", 1, "5");
            ProductRegistrationManager.RegisterNewProduct("tuxedo OscarDeLaRenta Design 43R", "690", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Bolivianos", 1, "5");
            ProductRegistrationManager.RegisterNewProduct("men tuxedo calvin klein", "1690", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Bolivianos", 1, "5");
            ProductRegistrationManager.RegisterNewProduct("honda motorcycle classic", "3090", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Motors", false, "Bolivianos", 1, "2");
            ProductRegistrationManager.RegisterNewProduct("iPad 2 16GB Wi-Fi", "690", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "5");

            ProductRegistrationManager.RegisterNewProduct("giftcard 20", "20", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("giftcard 30", "30", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("giftcard 40", "40", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("giftcard 50", "50", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("giftcard 60", "60", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("giftcard 70", "70", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("giftcard 80", "80", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("giftcard 90", "90", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("giftcard 100", "100", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("giftcard 110", "110", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("giftcard 120", "120", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Deals & Gifts", false, "Bolivianos", 1, "1");

            ProductRegistrationManager.RegisterNewProduct("product test giftcard 20", "20", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("product test giftcard 30", "30", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("product test giftcard 40", "40", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("product test giftcard 50", "50", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("product test giftcard 60", "60", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("product test giftcard 70", "70", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("product test giftcard 80", "80", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("product test giftcard 90", "90", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("product test giftcard 100", "100", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("product test giftcard 110", "110", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("product test giftcard 120", "120", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");


            ProductDataAccess.ViewProductsOnSale();
        }
        [TestMethod()]
        public void FailedViewProducts()
        {
            string firstName = "Pedro"; // TODO: Initialize to an appropriate value
            string lastName = "Suarez"; // TODO: Initialize to an appropriate value
            char gender = 'M'; // TODO: Initialize to an appropriate value
            Random rand = new Random();
            DateTime birthday = DateTime.Now.AddYears(-18); // TODO: Initialize to an appropriate value
            string email = "pedro" + rand.Next(400) + "@gmail.com"; // TODO: Initialize to an appropriate value
            //string email = "juan@hotmail.com";
            string password = "qwert1"; // TODO: Initialize to an appropriate value
            string rePassword = "qwert1"; // TODO: Initialize to an appropriate value
            string department = "Cochabamba"; // TODO: Initialize to an appropriate value
            string city = "Cercado"; // TODO: Initialize to an appropriate value
            string movilephone = "" + rand.Next(79999999); // TODO: Initialize to an appropriate value
            string phone = "" + rand.Next(4999999); // TODO: Initialize to an appropriate value
            Collection<RegisterError> actual;
            actual = UserRegistrationManager.RegisterUser(firstName, lastName, gender, birthday, email, password, rePassword, department, city, movilephone, phone);
            object objectTest;
            objectTest = ProductRegistrationManager.RegisterNewProduct("nintendo WII game deepack", "5234", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            ProductDataAccess.ViewProductsOnSale();
            Assert.AreNotEqual(null, objectTest);

        }

        /// <summary>
        ///A test for UpdateProducts
        ///</summary>
        [TestMethod()]
        public void UpdateProductsTest()
        {
            string firstName = "Pedro"; // TODO: Initialize to an appropriate value
            string lastName = "Suarez"; // TODO: Initialize to an appropriate value
            char gender = 'M'; // TODO: Initialize to an appropriate value
            Random rand = new Random();
            DateTime birthday = DateTime.Now.AddYears(-18); // TODO: Initialize to an appropriate value
            string email = "pedro" + rand.Next(400) + "@gmail.com"; // TODO: Initialize to an appropriate value
            string password = "qwert1"; // TODO: Initialize to an appropriate value
            string rePassword = "qwert1"; // TODO: Initialize to an appropriate value
            string department = "Cochabamba"; // TODO: Initialize to an appropriate value
            string city = "Cercado"; // TODO: Initialize to an appropriate value
            string movilephone = "" + rand.Next(79999999); // TODO: Initialize to an appropriate value
            string phone = "" + rand.Next(4999999); // TODO: Initialize to an appropriate value
            UserRegistrationManager.RegisterUser(firstName, lastName, gender, birthday, email, password, rePassword, department, city, movilephone, phone);
            Collection<Product> products = new Collection<Product>();
            products.Add(ProductRegistrationManager.RegisterNewProduct("computadoras portatiles", "54", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1"));
            products.Add(ProductRegistrationManager.RegisterNewProduct("deportivos americanos", "334", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Dollars", 1, "1"));
            ProductDataAccess.UpdateProducts(products);
        }

        /// <summary>
        ///A test for Product Recommendation Manager
        ///</summary>
        [TestMethod()]
        public void SuccesfullProductRecommendationTest()
        {
            string firstName = "Pedro"; // TODO: Initialize to an appropriate value
            string lastName = "Suarez"; // TODO: Initialize to an appropriate value
            char gender = 'M'; // TODO: Initialize to an appropriate value
            Random rand = new Random();
            DateTime birthday = DateTime.Now.AddYears(-18); // TODO: Initialize to an appropriate value
            string email = "pepe" + rand.Next(400) + "@yahoo.com"; // TODO: Initialize to an appropriate value
            //string email = "juan@hotmail.com";
            string password = "qwert1"; // TODO: Initialize to an appropriate value
            string rePassword = "qwert1"; // TODO: Initialize to an appropriate value
            string department = "Cochabamba"; // TODO: Initialize to an appropriate value
            string city = "Cercado"; // TODO: Initialize to an appropriate value
            string movilephone = "" + rand.Next(79999999); // TODO: Initialize to an appropriate value
            string phone = "" + rand.Next(4999999); // TODO: Initialize to an appropriate value
            Collection<RegisterError> actual;
            actual = UserRegistrationManager.RegisterUser(firstName, lastName, gender, birthday, email, password, rePassword, department, city, movilephone, phone);

            ProductRegistrationManager.RegisterNewProduct("iPhone apple 32GB", "524", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Dollars", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("calvin klein black scarf", "334", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Fashion", false, "Bolivianos", 1, "1");
            ProductRegistrationManager.RegisterNewProduct("iPhone apple 16GB", "624", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Dollars", 1, "4");
            ProductDataAccess.ViewRecommendedProductsOnSale(1,"Electronics");

        }
        /// <summary>
        ///A test for Product Recommendation Manager
        ///</summary>
        [TestMethod()]
        public void FailedProductRecommendationTest()
        {
            string firstName = "Pedro"; // TODO: Initialize to an appropriate value
            string lastName = "Suarez"; // TODO: Initialize to an appropriate value
            char gender = 'M'; // TODO: Initialize to an appropriate value
            Random rand = new Random();
            DateTime birthday = DateTime.Now.AddYears(-18); // TODO: Initialize to an appropriate value
            string email = "juan" + rand.Next(400) + "@hotmail.com"; // TODO: Initialize to an appropriate value
            //string email = "juan@hotmail.com";
            string password = "qwert1"; // TODO: Initialize to an appropriate value
            string rePassword = "qwert1"; // TODO: Initialize to an appropriate value
            string department = "Cochabamba"; // TODO: Initialize to an appropriate value
            string city = "Cercado"; // TODO: Initialize to an appropriate value
            string movilephone = "" + rand.Next(79999999); // TODO: Initialize to an appropriate value
            string phone = "" + rand.Next(4999999); // TODO: Initialize to an appropriate value
            Collection<RegisterError> actual;
            actual = UserRegistrationManager.RegisterUser(firstName, lastName, gender, birthday, email, password, rePassword, department, city, movilephone, phone);
            object objectTest;
            objectTest = ProductRegistrationManager.RegisterNewProduct("nintendo WII game deepack", "523", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Dollars", 1, "1"); 
            ProductDataAccess.ViewRecommendedProductsOnSale(1,"Electronics");
            Assert.AreNotEqual(null, objectTest);
        }

        /// <summary>
        ///A test for GetProductDescription
        ///</summary>
        [TestMethod()]
        public void GetProductDescriptionTest()
        {
            string firstName = "Pedro"; // TODO: Initialize to an appropriate value
            string lastName = "Suarez"; // TODO: Initialize to an appropriate value
            char gender = 'M'; // TODO: Initialize to an appropriate value
            Random rand = new Random();
            DateTime birthday = DateTime.Now.AddYears(-18); // TODO: Initialize to an appropriate value
            string email = "pedro12" + rand.Next(400) + "@gmail.com"; // TODO: Initialize to an appropriate value
            string password = "qwert1"; // TODO: Initialize to an appropriate value
            string rePassword = "qwert1"; // TODO: Initialize to an appropriate value
            string department = "Cochabamba"; // TODO: Initialize to an appropriate value
            string city = "Cercado"; // TODO: Initialize to an appropriate value
            string movilephone = "" + rand.Next(79999999); // TODO: Initialize to an appropriate value
            string phone = "" + rand.Next(4999999); // TODO: Initialize to an appropriate value
            UserRegistrationManager.RegisterUser(firstName, lastName, gender, birthday, email, password, rePassword, department, city, movilephone, phone);
            Product p = ProductRegistrationManager.RegisterNewProduct("iPhone 2 16GB apple", "34", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Bolivianos", 1, "1");
            string expected = "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf"; // TODO: Initialize to an appropriate value
            string actual;
            actual = ProductDataAccess.GetProductDescription(p.ProductId.ToString());
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for ViewAllProductsOnSale
        ///</summary>
        [TestMethod()]
        public void ViewAllProductsOnSaleTest()
        {
            Collection<Product> expected = null; // TODO: Initialize to an appropriate value
            Collection<Product> actual;
            actual = ProductDataAccess.ViewAllProductsOnSale();
            Assert.AreNotEqual(expected, actual);
        }

        /// <summary>
        ///A test for ViewProductQuantity
        ///</summary>
        [TestMethod()]
        public void ViewProductQuantityTest()
        {
            string firstName = "Pedro"; // TODO: Initialize to an appropriate value
            string lastName = "Suarez"; // TODO: Initialize to an appropriate value
            char gender = 'M'; // TODO: Initialize to an appropriate value
            Random rand = new Random();
            DateTime birthday = DateTime.Now.AddYears(-18); // TODO: Initialize to an appropriate value
            string email = "pedro" + rand.Next(400) + "@gmail.com"; // TODO: Initialize to an appropriate value
            //string email = "juan@hotmail.com";
            string password = "qwert1"; // TODO: Initialize to an appropriate value
            string rePassword = "qwert1"; // TODO: Initialize to an appropriate value
            string department = "Cochabamba"; // TODO: Initialize to an appropriate value
            string city = "Cercado"; // TODO: Initialize to an appropriate value
            string movilephone = "" + rand.Next(79999999); // TODO: Initialize to an appropriate value
            string phone = "" + rand.Next(4999999); // TODO: Initialize to an appropriate value
            UserRegistrationManager.RegisterUser(firstName, lastName, gender, birthday, email, password, rePassword, department, city, movilephone, phone);
            Product p = ProductRegistrationManager.RegisterNewProduct("iPhone 2 16GB apple", "234", "fafawfwef awefwfwefawfwef afwefawefawf fasfsafsaffsf", "Electronics", false, "Dollars", 1, "1");
            long productId = p.ProductId; // TODO: Initialize to an appropriate value
            object expected = null; // TODO: Initialize to an appropriate value
            object actual;
            actual = ProductDataAccess.ViewProductQuantity(productId);
            Assert.AreNotEqual(expected, actual);
        }

        /// <summary>
        ///A test for GetProductsAuctionByDate
        ///</summary>
        [TestMethod()]
        public void GetProductsAuctionByDateTest()
        {
            UserRegistrationManager.RegisterUser("Andrea", "Quiroga", 'F', DateTime.Now, "fabi_aqy@hotmail.com", "passwd123", "passwd123", "Cochabamba", "Cochabamba", "79718989", "4483251");
            string email = "fabi_aqy@hotmail.com"; // TODO: Initialize to an appropriate value
            User user = UserDataAccess.GetUserByEmail(email);
            Product product = ProductRegistrationManager.RegisterNewProduct("celular Nokia", "100", "este celular lo ayudara en todo es un samrtphone que tendra siempre lo que requiere es de color negro y tiene muchas funcionalidades", "Electronics", false, "Bolivianos", user.Id, "1");
            string initialAmount = "50"; // TODO: Initialize to an appropriate value
            string currency = "Dollars"; // TODO: Initialize to an appropriate value
            string productId = product.ProductId.ToString(CultureInfo.CurrentCulture); // TODO: Initialize to an appropriate value
            DateTime date = DateTime.Now.AddDays(2);// TODO: Initialize to an appropriate value
            int hour = 14; // TODO: Initialize to an appropriate value
            int minutes = 30; // TODO: Initialize to an appropriate value
            AuctionRegistrationManager.RegisterAuction(email, initialAmount, currency, productId, date, hour, minutes);
            Collection<Product> actual;
            actual = ProductDataAccess.GetProductsAuctionByDate(DateTime.Now, date.AddDays(3));
        }

        /// <summary>
        ///A test for Products
        ///</summary>
        [TestMethod()]
        public void ProductsTest()
        {
            Collection<Product> actual;
            actual = ProductDataAccess.Products();
        }

        /// <summary>
        ///A test for GetProductsAuctionByCategory
        ///</summary>
        [TestMethod()]
        public void GetProductsAuctionByCategoryTest()
        {
            string category = "Electronics"; // TODO: Initialize to an appropriate value
            Collection<Product> expected = new Collection<Product>(); // TODO: Initialize to an appropriate value
            Collection<Product> actual;
            actual = ProductDataAccess.GetProductsAuctionByCategory(category);
            Assert.AreNotEqual(expected, actual);
        }
    }
}
